<!DOCTYPE html>
<!--
  ~ Copyright (C) 2018 guomw.Inc. All rights reserved.
  ~ 项目名称： mysite
  ~ 文件名称： main.html
  ~ Date：18-9-6 下午4:09
  ~ Author: guomw
  -->

<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>数农商家中心</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <link rel="shortcut icon" href="../resource/favicon.ico" th:href="@{/resource/favicon.ico}"/>
    <link href="../resource/css/bootstrap.min.css?v=3.3.5" rel="stylesheet"
          th:href="@{/resource/css/bootstrap.min.css?v=3.3.5}"/>
    <link href="../resource/css/font-awesome.min.css?v=4.4.0" rel="stylesheet"
          th:href="@{/resource/css/font-awesome.min.css?v=4.4.0}"/>
    <link href="../resource/hotui/css/plugins/iconfont/iconfont.css"
          th:href="@{/resource/hotui/css/plugins/iconfont/iconfont.css}" rel="stylesheet"/>
    <link href="../resource/css/animate.min.css" rel="stylesheet" th:href="@{/resource/css/animate.min.css}"/>
    <link href="../resource/css/style.min-1.0.8.css" rel="stylesheet"
          th:href="@{/resource/css/style.min-1.0.8.css}"/>
    <link href="../resource/css/hotui.style.override.css" rel="stylesheet"
          th:href="@{/resource/css/hotui.style.override.css}"/>

    <style>
        .nav-header {
            padding: 20px 10px;
            display: flex;
            flex-direction: column;
        }

        .profile_small {
            width: 40px !important;
            border-radius: initial;
        }

        .profile-element {
            display: flex;
            flex-direction: row;
            align-content: center;
        }

        .profile-box {
            display: flex;
            flex-direction: column;
            align-content: center;
            justify-content: center;
            padding-left: 10px;
        }

        .profile-user {
            font-weight: bold;
        }

        .profile-btn-box {
            margin-top: 5px;
            font-size: 12px;

        }

        .profile-btn-box a {
            margin-right: 5px;
        }

        .mini-navbar .nav-title {
            display: none;
        }

        .nav-title {
            text-align: center;
            font-size: 24px;
            color: #ffffff;
            padding-bottom: 10px;
        }
    </style>
</head>
<body class="fixed-sidebar full-height-layout gray-bg" style="overflow:hidden">
<!--左侧菜单li元素模板-->

<div id="wrapper">
    <nav class="navbar-default navbar-static-side" role="navigation">
        <div class="nav-close">
            <i class="fa fa-times-circle"></i>
        </div>
        <div class="slimScrollDiv" style="position: relative; width: auto; height: 100%;">
            <div class="sidebar-collapse" style="width: auto; height: 100%;">
                <ul class="nav" id="side-menu">
                    <li class="nav-header">
                        <div class="nav-title">数农商家中心</div>
                        <div class="dropdown profile-element">
                        <span><img alt="image" class="img-circle profile_small" src="../resource/img/profile_small.jpg"
                                   th:src="@{/resource/img/profile_small.jpg}"/></span>
                            <div class="profile-box">
                                <div class="profile-user">
                                    <span style="color: #ffffff" th:text="${#authentication.getName()}">admin</span>
                                </div>
                                <div class="profile-btn-box">
                                    <a><i class="fa fa-circle text-warning"></i>
                                        在线</a>
                                    <a href="javascript:changePassShow()">
                                        <i class="fa fa-cog text-success"></i>
                                        设置</a>
                                    <a th:href="@{/logout}" href="/logout"><i class="fa fa-sign-out text-danger"></i>注销</a>
                                </div>
                            </div>
                        </div>
                        <!--                        <div class="dropdown profile-element">-->
                        <!--                        <span>-->
                        <!--                            <h1 style="color: #ea6262;font-size: 24px;font-weight: bolder;">数农商家中心</h1>-->
                        <!--                        </span>-->
                        <!--                            <p style="height: 20px;"></p>-->
                        <!--                            <span style="color: #DFE4ED; font-weight: 600;"></span>-->
                        <!--                            <input type="hidden" id="username" value="allan">-->
                        <!--                            <input type="hidden" id="managerId" value="5">-->
                        <!--                            <a data-toggle="dropdown" class="dropdown-toggle" href="#">-->
                        <!--                                <span class="clear">-->
                        <!--                                    <span class="block m-t-xs"><strong class="font-bold"-->
                        <!--                                                                       th:text="${#authentication.getName()}">狐狸</strong><b-->
                        <!--                                            class="caret"></b></span>-->
                        <!--                                </span>-->
                        <!--                            </a>-->

                        <!--                            <ul class="dropdown-menu animated fadeInDown m-t-xs">-->
                        <!--                                <li><a href="javascript:changePassShow()" data-index="0">修改密码</a>-->
                        <!--                                </li>-->
                        <!--                                <li class="divider"></li>-->
                        <!--                                <li><a href="/logout">安全退出</a>-->
                        <!--                                </li>-->
                        <!--                            </ul>-->
                        <!--                        </div>-->
                        <div class="logo-element">
                            甄宝
                        </div>
                    </li>
                    <li>
                        <a class="J_menuItem" href="/merchant/desktop" th:href="@{/merchant/desktop}" data-index="1">
                            <i class="iconfont">&#xe61e;</i>
                            <span class="nav-label">桌面</span>
                        </a>
                    </li>
                    <li>
                        <a href="#">
                            <i class="iconfont">&#xe631;</i>
                            <span class="nav-label">产品中心</span>

                            <span style="margin-top: 4px;" class="fa arrow"></span>
                        </a>
                        <ul class="nav nav-second-level collapse" aria-expanded="true" style="">
                            <li>
                                <a class="J_menuItem" href="#"
                                   th:href="@{/product/normalList(saleType=0)}"><span>普通商品</span></a>
                            </li>
                            <li>
                                <a class="J_menuItem" href="#"
                                   th:href="@{/product/normalList(saleType=1)}"><span>拍卖商品</span></a>
                            </li>
                        </ul>
                    </li>
                    <!--                    <li>-->
                    <!--                        <a class="J_menuItem" href="#" th:href="@{/auction/list(auctionStatus=1)}">-->
                    <!--                            <i class="iconfont">&#xe631;</i>-->
                    <!--                            <span class="nav-label">拍卖列表</span>-->

                    <!--                        </a>-->
                    <!--                    </li>-->
                    <li>
                        <a href="#">
                            <i class="iconfont">&#xe631;</i>
                            <span class="nav-label">订单管理</span>

                            <span style="margin-top: 4px;" class="fa arrow"></span>
                        </a>
                        <ul class="nav nav-second-level collapse" aria-expanded="true" style="">
                            <li>
                                <a class="J_menuItem" th:href="@{/order/list}"><span>订单列表</span></a>
                            </li>
                            <li>
                                <a class="J_menuItem" th:href="@{/order/afterSale/list}"><span>售后申请</span></a>
                            </li>
                            <li>
                                <a class="J_menuItem" th:href="@{/order/deliver/list}"><span>发货单</span></a>
                            </li>
                        </ul>
                    </li>
                    <li>
                        <a href="#">
                            <i class="iconfont">&#xe631;</i>
                            <span class="nav-label">营销推广</span>

                            <span style="margin-top: 4px;" class="fa arrow"></span>
                        </a>
                        <ul class="nav nav-second-level collapse" aria-expanded="true" style="">
                            <li>
                                <a class="J_menuItem" th:href="@{/marketing/redPacket/list}"><span>红包管理</span></a>
                            </li>
                        </ul>
                    </li>
                    <li>
                        <a class="J_menuItem" href="/contact/chat" th:href="@{/contact/chat}">
                            <i class="iconfont">&#xe631;</i>
                            <span class="nav-label">客服聊天</span>
                        </a>
                    </li>
                </ul>
            </div>
            <div class="slimScrollBar"
                 style="background: rgb(0, 0, 0); width: 4px; position: absolute; top: 0px; opacity: 0.4; display: none; border-radius: 7px; z-index: 99; right: 1px; height: 171.613px;"></div>
            <div class="slimScrollRail"
                 style="width: 4px; height: 100%; position: absolute; top: 0px; display: none; border-radius: 7px; background: rgb(51, 51, 51); opacity: 0.9; z-index: 90; right: 1px;"></div>
        </div>
    </nav>
    <!--左侧导航结束-->
    <!--右侧部分开始-->
    <div id="page-wrapper" class="gray-bg dashbard-1">
        <div class="row content-tabs">
            <button class="navbar-minimalize roll-nav roll-left"><i class="fa fa-bars"></i></button>
            <button class="roll-nav roll-left J_tabLeft" style="margin-left: 40px"><i class="fa fa-backward"></i>
            </button>
            <nav class="page-tabs J_menuTabs" style="margin-left: 80px;">
                <div class="page-tabs-content">
                    <a href="javascript:;" class="active J_menuTab" th:attr="data-id=@{/merchant/desktop}"
                       data-id="/desktop">桌面</a>
                </div>
            </nav>
            <button class="roll-nav roll-right J_tabRight" style="right: 80px;  "><i class="fa fa-forward"></i>
            </button>
            <div class="btn-group roll-nav roll-right">
                <button class="dropdown J_tabClose" data-toggle="dropdown">关闭操作<span class="caret"></span>

                </button>
                <ul role="menu" class="dropdown-menu dropdown-menu-right">
                    <li class="J_tabShowActive"><a>定位当前选项卡</a>
                    </li>
                    <li class="divider"></li>
                    <li class="J_tabCloseAll"><a>关闭全部选项卡</a>
                    </li>
                    <li class="J_tabCloseOther"><a>关闭其他选项卡</a>
                    </li>
                </ul>
            </div>
            <a href="logout" class="roll-nav roll-right J_tabExit"><i class="fa fa fa-sign-out"></i> 退出</a>
        </div>
        <div class="row J_mainContent" id="content-main">
            <iframe class="J_iframe" name="iframe0" width="100%" height="100%" th:src="@{/merchant/desktop}"
                    frameborder="0" th:attr="data-id=@{/merchant/desktop}"
                    data-id="/desktop" seamless></iframe>
        </div>
    </div>
    <!--右侧部分结束-->
    <script type="text/html" id="change_pass_modal">
        <div class="form-horizontal" style="width: 400px;">
            <div class="form-group ">
                <label class="col-sm-3 control-label">旧密码:</label>

                <div class="col-sm-7">
                    <input id="origin" type="password" class="form-control input-sm"
                           placeholder="旧密码"/>
                </div>
            </div>
            <div class="hr-line-dashed "></div>
            <div class="form-group ">
                <label class="col-sm-3 control-label">新密码:</label>

                <div class="col-sm-7">
                    <input id="newPass" type="password" class="form-control input-sm"
                           placeholder="新密码"/>
                </div>
            </div>
            <div class="hr-line-dashed "></div>
            <div class="form-group ">
                <label class="col-sm-3 control-label">确认密码:</label>

                <div class="col-sm-7">
                    <input id="confirmPass" type="password" class="form-control input-sm"
                           placeholder="确认密码"/>
                </div>
            </div>
        </div>
    </script>

    <script src="../resource/js/jquery.min.js?v=2.1.4" th:src="@{/resource/js/jquery.min.js?v=2.1.4}"></script>
    <script src="../resource/js/bootstrap.min.js?v=3.3.5" th:src="@{/resource/js/bootstrap.min.js?v=3.3.5}"></script>
    <script src="../resource/js/plugins/metisMenu/jquery.metisMenu.js"
            th:src="@{/resource/js/plugins/metisMenu/jquery.metisMenu.js}"></script>
    <script src="../resource/js/plugins/slimscroll/jquery.slimscroll.min.js"
            th:src="@{/resource/js/plugins/slimscroll/jquery.slimscroll.min.js}"></script>
    <script src="../resource/js/plugins/layer/layer.min.js"
            th:src="@{/resource/js/plugins/layer/layer.min.js}"></script>
    <script src="../resource/js/hplus.min.js?v=4.0.0" th:src="@{/resource/js/hplus.min.js?v=4.0.0}"></script>
    <script type="text/javascript" src="../resource/js/contabs.min.js?1a234"
            th:src="@{/resource/js/contabs.min.js?1a234}"></script>
    <script src="../resource/js/plugins/pace/pace.min.js" th:src="@{/resource/js/plugins/pace/pace.min.js}"></script>
    <script src="../resource/js/plugins/hot/Jquery.util.js"
            th:src="@{/resource/js/plugins/hot/Jquery.util.js}"></script>
    <script src="../resource/hotui/js/hot/bootstrap.hot.extra-utils.js?20190316"
            th:src="@{/resource/hotui/js/hot/bootstrap.hot.extra-utils.js?20190316(123123)}"></script>

    <script type="text/javascript" th:inline="javascript">
        const changePassUri = /*[[@{/changePass}]]*/  "";
    </script>
    <script>
        var changePassModal = $("#change_pass_modal").modal("修改密码", function () {
            let origin = $.trim($("#origin").val());
            let newPass = $.trim($("#newPass").val());
            let confirmPass = $.trim($("#confirmPass").val());
            if (origin.length === 0) {
                hot.tip.msg("请输入旧密码");
                return;
            }
            if (newPass.length === 0) {
                hot.tip.msg("请输入新密码");
                return;
            }
            if (confirmPass !== newPass) {
                hot.tip.msg("两次密码输入不一致");
                return;
            }

            hot.ajax(changePassUri, {
                origin: origin,
                newPass: newPass
            }, function (apiResult) {
                if (apiResult.resultCode === 2000) {
                    hot.tip.success("修改成功，请重新登录", function () {
                        window.location.reload();
                    });
                } else {
                    hot.tip.error(apiResult.resultMsg);
                }
            }, function () {
            }, "post", 300);
        });

        function newTab(url, name) {
            var index = false;
            $(".page-tabs-content .J_menuTab").each(function () {
                var dataId = $(this).attr("data-id");
                if (dataId == url) {
                    index = true;
                    $(this).click();
                    var loado = layer.load();
                    var jiframe = $('.J_iframe[data-id="' + url + '"]');
                    jiframe.attr("src", jiframe.attr("src"));
                    jiframe.load(function () {
                        layer.close(loado);
                    });
                    return false;
                }
            });
            if (!index) {
                var s = '<a href="javascript:;" class="active J_menuTab" data-id="' + url + '">' + name + ' <i class="fa fa-times-circle"></i></a>';
                $(".J_menuTab").removeClass("active");
                var r = '<iframe class="J_iframe" width="100%" height="100%" src="' + url + '" frameborder="0" data-id="' + url + '" seamless></iframe>';
                $(".J_mainContent").find("iframe.J_iframe").hide().parents(".J_mainContent").append(r);
                var o = layer.load();
                $(".J_mainContent iframe:visible").load(function () {
                    layer.close(o)
                }),
                    $(".J_menuTabs .page-tabs-content").append(s);
            }
        }

        function changePassShow() {
            changePassModal.show();
        }

        function closeActiveTab() {
            $(".page-tabs-content").find('.active').find('.fa-times-circle').click();
        }

        function refreshTab(dataId) {
            $(".page-tabs-content").find(".J_menuTab[data-id='" + dataId + "']").dblclick();
        }
    </script>
</div>
</body>
</html>